#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Named Instance Base Class
 *      Provides a base class for the INamedInstance Implementation.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "GenericCollectionBase.h"

using namespace System;

namespace Adaptive
{
	namespace Foundation
	{
		/// <summary>
		/// rovides a base class for the <see cref="INamedInstance"/> implementation.
		/// </summary>
		/// <remarks>
		/// The <see cref="INamedInstance"/> interface and <see cref="NamedInstanceBase"/> class are intended to provide
		/// a basic platform for implementing object trees for items which may require a 
		/// unique name or identifier.  These object derivatives are ideal for use with the 
		/// <see cref="GenericCollectionBase"/> class.
		/// </remarks>
		public ref class NamedInstanceBase abstract : public INamedInstance
		{
		public:
			/*--------------------------------------------------------------------------------
			 * Public Event Definitions
			 *------------------------------------------------------------------------------*/
			#pragma region Public Event Definitions
			/// <summary>
			/// Occurs when the name value is modified.
			/// </summary>
			virtual event EventHandler^ NameChanged;
			#pragma endregion

			/*--------------------------------------------------------------------------------
			 * Public Properties
			 *------------------------------------------------------------------------------*/
			#pragma region Public Properties
			/// <summary>
			/// Gets or sets the unique name value assigned to the instance.
			/// </summary>
			/// <value>
			/// A unique string value assigned to a specific object instance.
			/// </value>
			virtual property String^ Name { virtual String^ get(); virtual void set(String^ value); }
			#pragma endregion
 
			/*--------------------------------------------------------------------------------
			 * Event Methods / Event Methods
			 *------------------------------------------------------------------------------*/
			#pragma region Protected Methods / Event Methods
			/// <summary>
			/// Raises the <see cref="NameChanged"/> event.
			/// </summary>
			/// <param name="e">
			/// An <see cref="EventArgs"/> event arguments instance.
			/// </param>
			virtual void OnNameChanged(EventArgs^ e);
			#pragma endregion

		protected:
			/*--------------------------------------------------------------------------------
			 * Constructor / Dispose / Destructor Methods
			 *------------------------------------------------------------------------------*/
			#pragma region Constructor / Dispose / Destructor Methods
			/// <summary>
			/// Initializes a new instance of the class.
			/// </summary>
			/// <remarks>
			/// This is the default constructor.
			/// </remarks>
			NamedInstanceBase();
			/// <summary>
			/// Class destructor.
			/// </summary>
			~NamedInstanceBase();
			#pragma endregion

		private:
			/*--------------------------------------------------------------------------------
			 * Private Member Declarations
			 *------------------------------------------------------------------------------*/
			#pragma region Private Member Declarations
			/// <summary>
			/// Name value.
			/// </summary>
			String^ _name;
			#pragma endregion
		};
	}
}
